package com.jswlw.service.base.impl;

import com.jswlw.dao.base.DictionaryMapper;
import com.jswlw.entity.base.Dictionary;
import com.jswlw.service.base.DictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by wu on 2017-12-14.
 */
@Service
public class DictionaryServiceImpl implements DictionaryService {

    @Autowired
    DictionaryMapper dictionaryMapper;

    @Override
    public List<Dictionary> findAll(Map condition) {
        return dictionaryMapper.findAll(condition);
    }

    @Override
    public Dictionary findOne(Integer id) {
        return dictionaryMapper.selectByPrimaryKey(id);
    }

    @Override
    public int insert(Dictionary dictionary) {
        return dictionaryMapper.insertSelective(dictionary);
    }

    @Override
    public int update(Dictionary dictionary) {
        return dictionaryMapper.updateByPrimaryKeySelective(dictionary);
    }

    @Override
    public int delete(Integer id) {
        return dictionaryMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int findCount(Map map) {
        return dictionaryMapper.findCount(map);
    }

    @Override
    public List<Dictionary> searchPage(Map map) {
        return null;
    }
}
